package com.naml.i_transtream;

import java.io.*;

/**
 * @author marin
 * @version 1.0
 * @date 2025/4/24 21:41
 * @desc 由一个文件乱码的问题引出转换流的作用
 */
@SuppressWarnings("all")
public class TransFormation {
    public static void main(String[] args) {
        String path = "/Users/marin/new3.txt";
        BufferedReader br = null;
        try {
            //默认情况下，按照UTF-8的编码读取的（可以去改下源文件的编码，就暴露问题了）
            br = new BufferedReader(new FileReader(path));
            System.out.println(br.readLine());
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                br.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
